﻿<!-- #include file="cjf.asp" -->
<!--#include file="conn.asp"-->
<!--#include file="inc/CHAR.INC"-->
<%
cjid=request("cjid")
set rs=server.CreateObject("ADODB.RecordSet")
sql="select * from cjxm where id="&cjid
rs.open sql,conn,1,3
xmmc=rs("xmmc")
xmfd=rs("xmfd")
xmsx=rs("xmsx")
gxurl=rs("gxurl")
gxbody=rs("gxbody")
gxfg=rs("gxfg")
gxmc=rs("gxmc")
gxid=rs("gxid")

rs.close
if request("gxurl")="" then
gxurl=gxurl
else
gxurl=request("gxurl")
end if%><html>
<head>
    <title>漫画采集</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link href="images/style.css" type="text/css" rel="stylesheet">
    <script language="JavaScript" src="inc/js.js" type="text/javascript"></script>
    <style type="text/css">
<!--
.STYLE1 {color: #999999}
-->
</style>
</head>
<body>
    <center>
        <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
            <tr>
                <td height="30" bgcolor="e7e7e7">
                    <div align="left">
                        <strong>
                            <%=xmmc%>数据更新 </strong>
                    </div>
                </td>
            </tr>
            <form action="" method="get" name="formcj">
            <input name="act" type="hidden" value="cj">
            <input name="cjid" type="hidden" value="<%=request("cjid")%>">
            <tr>
                <td bgcolor="#FFFFFF">
                    &nbsp;更新页地址(最新更新列表页的URL地址)：
                    <input name="gxurl" type="text" value="<%=gxurl%>" size="50">
                    <input name="submit" type="submit" class="Submit" value="开始更新">
                </td>
            </tr>
            </form>
        </table>
        <table width="98%" border="0" align="center" cellpadding="8" cellspacing="1" bgcolor="#CCCCCC"
            style="margin-top: 5px">
            <tr>
                <td width="100%" colspan="3" bgcolor="#FFFFFF">
                    <%if request("act")="cj" then%>
                    <%
Server.ScriptTimeOut=99999
cjid=request("cjid")
url=request("gxurl")
if url="" then
   Response.write "&nbsp;请输入更新列表页地址&nbsp;&nbsp;<A HREF=# onclick=""Javascript:history.back(-1)""><FONT  COLOR=#FF0000>请点这里返回</FONT></A>"
   Response.End
end if
   Caijimake
Sub Caijimake

MakeIMG
End Sub

Sub MakeIMG
Dim k:k=0




url=bqtf1(gxurl)
gxbody=bqtf1(gxbody)
gxfg=bqtf1(gxfg)
gxid=bqtf1(gxid)
gxmc=bqtf1(gxmc)



gxbody1=Split(gxbody,"$")
gxid1=Split(gxid,"$")
gxmc1=Split(gxmc,"$")

zlp=GetHttp(url) 

'采集相关信息开始
body=GetStr(zlp,gxbody1(0),gxbody1(1))

body2=Split(body,""&gxfg&"")
bodys=ubound(body2) 
'开始写入数据

'===================================================
'RString=DeHttpdata(zlp,"'[^<>'']*','[^<>'']*','[^<>""]*'")
Response.write "<table border=0 width=100% align=center>"
Response.write  "<form method=""post"" name=""form1"" id=""form1""><tr><td width=100% colspan=""5"">"

Response.Write "<b>&nbsp;&nbsp;共找到："&bodys&"部漫画</b>"
Response.write "</td></tr>"

response.flush

for i=0 to bodys
gxidx=gxidx&i
gxidx=GetStr(body2(i),gxid1(0),gxid1(1))
gxmcx=GetStr(body2(i),gxmc1(0),gxmc1(1))
if (i mod 2)=0 and i>=2 then
Response.write "<tr>"
end if
Response.Write "<td>"
gxmcx=trim(gxmcx)
if instr(gxmcx,"[")<>0  then
gxmcx2=Split(gxmcx,"[")
gxmcx3=gxmcx2(0)
else
gxmcx3=gxmcx
end if
if instr(gxmcx,"index.htm'>")<>0  then
gxmcx4=Split(gxmcx3,"index.htm'>")
gxmcx5=gxmcx4(1)
else
gxmcx5=gxmcx3
end if



Sql="Select * From cjlog where mcmc='"&gxmcx5&"'"
Rs.Open Sql,Conn,1,3
if rs.eof then
Rs.AddNew
rs("cjid")=cjid
rs("mcmc")=gxmcx5
rs("mhid")=trim(gxidx)
rs("adddate")=now()
rs.update
Response.Write "<font color=red>"
else
end if
rs.close
Sql="Select * From cjlog where mcmc='"&gxmcx5&"'"
Rs.Open Sql,Conn,1,3
if not rs.eof then
cjid2=rs("id")
end if
rs.close
Response.Write "&nbsp;&nbsp;"&gxidx&"&nbsp;&nbsp;"&gxmcx5&"&nbsp;</font>"
response.write"<iframe src='cj_comic.asp?act=out&cjid="&cjid2&"' name='1' width='40' marginwidth='0' height='20' marginheight='0' align='middle' scrolling='no' frameborder='0'></iframe><td>"
response.flush
if (i mod 2)=0 and i>=2 then
Response.write "</tr>"
end if

next

End Sub

                    %>
                    <%else%>
                    <span class="STYLE1">正在等待开始采集漫画数据....</span>
                    <%end if%>
                </td>
            </tr>
        </table>
    </center>
</body>
</html>
